<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组去重</title>
</head>
<body>
    <script>
            var nums = [1, 5, 4, 4, 7, 6, 6];
            var newArr = [];
            var flag = false;
            var count = 0;
            for (var i = 0; i < nums.length; i++) {
                flag=false;
                for (var j = i + 1; j < nums.length; j++) {
                    if (nums[i] == nums[j]) {
                        flag = true;
                        break;
                    }
                }
                if (!flag) {
                newArr.push(nums[i]);
                }
            }document.write(newArr);
    </script>
</body>
</html>